package com.accounting.client;

import com.accounting.client.frontend.Perspective;
import com.accounting.client.session.SessionManager;
import com.accounting.client.session.login.LoginScreen;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

import corelib.client.GwtUtil;
import corelib.client.delegate.CompleteCallback;
import corelib.client.resource.GwtWidgetStyle;
import corelib.client.ui.FontSize;
import corelib.client.ui.SimpleModal;

public class Box implements EntryPoint {

	public void onModuleLoad() {
		GwtUtil.registerUncaughtExceptionLogger();
		FontSize.init();
		SimpleModal.Enabled = true;
		GwtWidgetStyle.ensureInjected();
		
		RootPanel.get().getElement().getStyle().setBackgroundColor("#ffffff");
		final LoginScreen logInScreen = new LoginScreen();
		SessionManager.init(logInScreen, new CompleteCallback(){
			@Override
			public void onCompleted() {
				logInScreen.hide();
				ApplicationContext.Init(new CompleteCallback(){
					@Override
					public void onCompleted() {
						Perspective.show();
					}
				});
			}
		});

    }
}
